package com.google.sky.dto;

import com.google.sky.domain.Mark;

import java.io.Serializable;
import java.util.List;

public class BoardSettings implements Serializable {
    private String errorCode="0";
    private String height;
    private String width;
    private List<List<Mark>> states;
    private String message = "";

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getHeight() {
        return height;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static BoardSettings withError(int error){
        return withError(error,"");
    }

    public List<List<Mark>> getStates() {
        return states;
    }

    public void setStates(List<List<Mark>> states) {
        this.states = states;
    }

    public static BoardSettings withError(int error, String message){
       BoardSettings boardSettings = new BoardSettings();
       boardSettings.setErrorCode(String.valueOf(error));
       boardSettings.setMessage(message);
       return boardSettings;
    }

    public static BoardSettings widthSize(int h, int w){
        BoardSettings boardSettings = new BoardSettings();
        boardSettings.setHeight(String.valueOf(h));
        boardSettings.setWidth(String.valueOf(w));
        return boardSettings;
    }
}
